<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui" xml:lang="en" lang="en">
<head>
    <title>My Facelets Page</title>
    <meta http-equiv="keywords" content="enter,your,keywords,here"/>
    <meta http-equiv="description"
          content="A short description of this page."/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

    <!--<link rel="stylesheet" type="text/css" href="styles.css">-->
</head>
<body>
<ui:composition template="BackGeneral.xhtml">
    <ui:define name="content">
        <h:form id="fm">
            <div>
                <h:outputText id="outputText1"
                              styleClass="tit"
                              value="－修改系统图片－"/>
                <p:separator/>
                <h:panelGrid columns="2">
                    <h:outputText value="名称："/>
                    <h:inputText value="#{aAdv.adv.name}" style="width:400px"/>
                    <h:outputText value="链接地址："/>
                    <h:inputText value="#{aAdv.adv.url}" style="width:400px"/>

                    <h:outputText value="图像："/>
                    <h:graphicImage id="simg" url="#{aAdv.adv.src}" style="width:100%;border:1px solid gray;"/>

                    <h:outputLabel style=""
                                   value="图片源："/>

                    <h:panelGrid columns="1">
                        <h:panelGroup>
                            <h:inputText id="title" value="#{aAdv.adv.src}"
                                         style="width:400px">
                                <f:ajax event="change" render="simg"/>
                            </h:inputText>
                        </h:panelGroup>
                        <h:outputText style="color:red" value="本图宽应为：#{aAdv.adv.width}，高为：#{aAdv.adv.height}"/>
                    </h:panelGrid>
                    <h:outputLabel style=""
                                   value="上传："/>
                    <p:fileUpload id="upl" fileUploadListener="#{aAdv.up_action}" update="simg title" uploadLabel="上传"
                                  auto="true" label="选择图片" allowTypes="/(\.|\/)(gif|jpe?g|png)$/">
                    </p:fileUpload>
                    <h:outputText value="描述："/>
                    <h:inputTextarea value="#{aAdv.adv.description}" style="width:400px;height:100px"/>
                </h:panelGrid>
                <p:separator/>
                <p:commandButton action="#{aAdv.button1_action}" value="提交" ajax="false" styleClass="commonSubmit"/>

            </div>
        </h:form>
    </ui:define>
</ui:composition>
</body>
</html>
